/*
 * Copyright (c) 2001-2018 GuaHao.com Corporation Limited. All rights reserved.
 * This software is the confidential and proprietary information of GuaHao Company.
 * ("Confidential Information").
 * You shall not disclose such Confidential Information and shall use it only
 * in accordance with the terms of the license agreement you entered into with GuaHao.com.
 */
package com.bgt.springboot.first.test;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * TODO
 *
 * @author Ricky
 * @version V1.0
 * @since 2018-08-01 11:44
 */
public class Reg {
    public static void main2(String[] args) {
        String str = "温度调整到1000度1";
        String reg = "[\u4e00-\u9fa5]";
        Pattern pat = Pattern.compile(reg);
        Matcher mat=pat.matcher(str);
        System.out.print(mat.replaceAll(""));
    }

    public static void main3(String[] args) {
        String str = "温度调1整\\123到1000 度/1_AB";
        String reg = "[^a-zA-Z0-9\\/\\\\]";
        Pattern pat = Pattern.compile(reg);
        Matcher mat=pat.matcher(str);
        System.out.print(mat.replaceAll(""));
    }
    public static void main(String[] args) {
        String content = "  1 ";
        String reg = "\\s*";// 空格
        Pattern pat = Pattern.compile(reg);
        Matcher mat=pat.matcher(content);
        System.out.print(mat.replaceAll(""));
    }
}
